/*
 * Tangram
 * Copyright 2009 Baidu Inc. All rights reserved.
 * 
 * path: baidu/browser/safari.js
 * author: allstar, rocy
 * version: 1.1.0
 * date: 2009/11/23
 */

///import baidu.browser;

(function(){
    var ua = navigator.userAgent;
    /*
     * 兼容浏览器为safari或ipad,其中,一段典型的ipad UA 如下:
     * Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
     */
    if(/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(ua) && !/chrome/i.test(ua)){
        /**
         * 判断是否为safari浏览器, 支持ipad
         * @property safari safari版本号
         * @grammar baidu.browser.safari
         * @meta standard
         * @see baidu.browser.ie,baidu.browser.firefox,baidu.browser.opera,baidu.browser.chrome   
         */
    	baidu.browser.safari = + (RegExp['\x241'] || RegExp['\x242']);
    }
})();
